﻿<%@ Page Title="" Language="C#" ValidateRequest="false" MasterPageFile="~/Areas/Admin/Views/Shared/AdminSite.Master" Inherits="System.Web.Mvc.ViewPage<Sys.WebRes.Publish.Areas.Admin.Models.ResourceModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	文章编辑
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
<script src="<%=Url.Content("~/Content/Admin/tiny_mce/tiny_mce.js") %>" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
    tinyMCE.init({
        // General options 
        //mode: "textareas",
        //language:"zh-CN",
        mode:"exact",
        elements:"Contents",
        theme: "advanced", //simple  advanced
        plugins: "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

        // Theme options 
        theme_advanced_buttons1: "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3: "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4: "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
        theme_advanced_toolbar_location: "top",
        theme_advanced_toolbar_align: "left",
        theme_advanced_statusbar_location: "bottom",
        theme_advanced_resizing: true,

        // Example content CSS (should be your site CSS) 
        content_css: "<%=Url.Content("~/Content/Admin/tiny_mce/themes/advanced/skins/highcontrast/content.css") %>",

        // Drop lists for link/image/media/template dialogs 
        template_external_list_url: "js/template_list.js",
        external_link_list_url: "js/link_list.js",
        external_image_list_url: "js/image_list.js",
        media_external_list_url: "js/media_list.js",

        // Replace values for the template plugin 
        template_replace_values: {
            username: "Some User",
            staffid: "991234"
        },

        execcommand_callback:"myCustomExecCommandHandler"
    });

    function myCustomExecCommandHandler(editor_id, elm, command, user_interface, value){
      
        if(command == "mceFullScreen"){
            
        }
    }

//    //初始化
//    $().ready(function(){
//        $("#AddSection").click(function(){
//            var count = $(".secSign").length;
//            var div = $('<div id="sectionInput_' + count + '" class="secSign">');
//            $('<select name="Sections[' + count + '].SectionID"></select>').html($("#Sections_0__SectionID").html()).appendTo(div).val(0);
//            $('<label>序号</label><input type="text" name="Sections[' + count + '].OrderNo" value=""/>').appendTo(div);
//            $('<label>置顶</label><input type="checkbox" name="Sections[' + count + '].TopLevel" value="True" />').appendTo(div);
//            $('<input name="Sections[' + count + '].TopLevel" type="hidden" value="false" />').appendTo(div);
//            div.appendTo("#SectionTd");
//        });
//    });
</script>
<%Html.RenderAction("TagView", "Dropdown"); %>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="BodyContent" runat="server">
    <% using (Html.BeginForm()) {%>
        <%= Html.ValidationSummary(true) %>
        <% string a = Html.HiddenFor(model => model.ID).ToHtmlString(); System.Diagnostics.Debug.WriteLine(a); %>
        <%= Html.HiddenFor(model => model.ID) %>
        <%= Html.HiddenFor(model => model.ResTypeID)%>
        <%= Html.HiddenFor(model => model.AutoSave) %>
        <fieldset>
            <legend>文章数据项</legend>
            <table style="width:100%">
                <%Html.RenderPartial("SectionInfoView", Model); %>
                <%Html.RenderPartial("FileResBaseView", Model); %>

                <tr><td class="editor-label">
                    <label for="Contents">内 容</label>
                </td>
                <td class="editor-field" style="height:350px;">
                    <div id="editorPanel">
                        <%= Html.TextAreaFor(model => model.Contents, new { @rows = 25, @cols = 100 })%>
                        <%= Html.ValidationMessageFor(model => model.Contents) %>
                    </div>
                </td>
                </tr>
                <tr><td class="editor-label">
                    <label for="">关联资源</label>
                </td>
                <td class="editor-field">
                    关联到
                    <br /><br /><br />
                </td>
                </tr>
                <%Html.RenderPartial("CreatInfoView", Model); %>
                <%Html.RenderPartial("CountInfoView", Model); %>
                <%Html.RenderPartial("GlobalInfoView", Model);%>
                <%Html.RenderPartial("StatusInfoView", Model);%>
            </table>
            
            <p style="text-align:center;height:100px;">
            <a class="easyui-linkbutton" href="javascript:document.forms[0].submit();" onclick="">保 存</a>
            <a class="easyui-linkbutton" href="javascript:void(0)" onclick="">取 消</a>
            </p>
        </fieldset>
    <% } %>
</asp:Content>

